import {ParamMap, Router} from "@angular/router";
import {Injectable} from "@angular/core";

@Injectable({
  providedIn: 'root'
})
export class HeaderService {

  private _title: string = "工作区";
  // 深度
  private _secondTitle: string = "";
  // 深度
  private _depth: number = 1;
  // 返回
  private _backRouter = "/";

  get title(): string {
    return this._title;
  }

  get secondTitle(): string {
    return this._secondTitle;
  }

  get depth(): number {
    return this._depth;
  }

  get backRouter(): string {
    return this._backRouter;
  }

  setOneNavigation(title: string): void {
    this._depth = 1;
    this._title = title;
    this._backRouter = "/";
  }

  setSecondNavigation(backRouter: string, title: string): void {
    this._depth = 2;
    this._title = title;
    this._backRouter = backRouter;
  }

  setThirdNavigation(backRouter: string, title: string, secondTitle: string = ""): void {
    this._depth = 3;
    this._title = title;
    this._secondTitle = secondTitle;
    this._backRouter = backRouter;
  }

  setFourNavigation(backRouter: string, title: string, secondTitle: string): void {
    this._depth = 4;
    this._title = title;
    this._secondTitle = secondTitle;
    this._backRouter = backRouter;
  }

}

